package com.inch.web.util;

import com.google.code.kaptcha.Constants;

import javax.servlet.http.HttpServletRequest;

public class CodeUtil {
    public static boolean checkVerifyCode(HttpServletRequest request,String userInput){
        String expect = (String) request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY);
        if(expect.toLowerCase().equals(userInput.toLowerCase())){
            return true;
        }else {
            return false;
        }
    }
}
